<template>
    <div class="edu-page-warp">
        <condition-card @reset="reset" @search="onSubmit" label-width="110px">
            <el-row :gutter="24">
                <el-col :span="8">
                    <el-form-item :label="$t('label.schoolTerm')">
                        <CalendarSelect
                            v-model="queryForm.calendarId"
                            @load-done="done"
                            @change="calendarChange"
                            :all="true"
                        ></CalendarSelect>
                    </el-form-item>
                </el-col>
                <el-col :span="8">
                    <el-form-item :label="$t('stuRegister.registStatus')">
                        <el-select
                            v-model="queryForm.registStatus"
                            style="width: 100%;"
                            clearable
                            :placeholder="$t('common.text.all')"
                        >
                            <el-option
                                v-for="item in options.registStatus"
                                :key="item.value"
                                :label="item.label"
                                :value="item.value"
                            />
                        </el-select>
                    </el-form-item>
                </el-col>
                <el-col :span="8">
                    <el-form-item :label="$t('tutorAuth.currentGrade')">
                        <el-date-picker
                            v-model="queryForm.currentGrade"
                            value-format="yyyy"
                            type="year"
                            :placeholder="$t('common.text.all')"
                            style="width: 100%"
                            @change="currentDptId == '1' ? changeFaculty() : ''"
                        />
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row :gutter="24">
                <el-col :span="8">
                    <el-form-item :label="$t('label.college')">
                        <el-select
                            v-model="queryForm.facultyList"
                            multiple
                            collapse-tags
                            style="width: 100%;"
                            @change="changeFaculty"
                            clearable
                            :placeholder="$t('common.text.all')"
                        >
                            <el-option
                                v-for="item in options.college"
                                :key="item.value"
                                :label="item.label"
                                :value="item.value"
                            />
                        </el-select>
                    </el-form-item>
                </el-col>
                <el-col :span="8">
                    <el-form-item :label="$t('label.major')">
                        <el-select
                            v-model="queryForm.professionList"
                            multiple
                            collapse-tags
                            style="width: 100%;"
                            clearable
                            :placeholder="$t('common.text.all')"
                        >
                            <el-option
                                v-for="item in options.major"
                                :key="item.value"
                                :label="item.label"
                                :value="item.value"
                            />
                        </el-select>
                    </el-form-item>
                </el-col>
                <el-col :span="8">
                    <el-form-item :label="$t('label.trainingLevel')">
                        <el-select
                            v-model="queryForm.trainingLevelList"
                            multiple
                            collapse-tags
                            style="width: 100%;"
                            clearable
                            :placeholder="$t('common.text.all')"
                        >
                            <el-option
                                v-for="item in options.trainingLevel"
                                :key="item.value"
                                :label="item.label"
                                :value="item.value"
                            />
                        </el-select>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row :gutter="24">
                <el-col :span="8">
                    <el-form-item :label="$t('label.trainingCategory')">
                        <el-select
                            v-model="queryForm.trainingCategory"
                            style="width: 100%;"
                            clearable
                            :placeholder="$t('common.text.all')"
                        >
                            <el-option
                                v-for="item in options.trainingCategory"
                                :key="item.value"
                                :label="item.label"
                                :value="item.value"
                            />
                        </el-select>
                    </el-form-item>
                </el-col>
                <el-col :span="8">
                    <el-form-item :label="$t('dic.degreeType')">
                        <el-select
                            v-model="queryForm.degreeType"
                            style="width: 100%;"
                            clearable
                            :placeholder="$t('common.text.all')"
                            @change="currentDptId != '1' ? changeFaculty() : ''"
                        >
                            <el-option
                                v-for="item in options.degreeType"
                                :key="item.value"
                                :label="item.label"
                                :value="item.value"
                            />
                        </el-select>
                    </el-form-item>
                </el-col>
                <el-col :span="8">
                    <el-form-item :label="$t('label.formLearning')">
                        <el-select
                            v-model="queryForm.formLearning"
                            style="width: 100%;"
                            clearable
                            :placeholder="$t('common.text.all')"
                        >
                            <el-option
                                v-for="item in options.formLearning"
                                :key="item.value"
                                :label="item.label"
                                :value="item.value"
                            />
                        </el-select>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row :gutter="24">
                <el-col :span="8">
                    <el-form-item :label="$t('label.isOverseas')">
                        <el-select
                            v-model="queryForm.isOverseas"
                            style="width: 100%;"
                            clearable
                            :placeholder="$t('common.text.all')"
                        >
                            <el-option
                                v-for="item in options.isOverseas"
                                :key="item.value"
                                :label="item.label"
                                :value="item.value"
                            />
                        </el-select>
                    </el-form-item>
                </el-col>
                <el-col :span="8">
                    <el-form-item :label="$t('score.studebtScoreQueryForLeave.enterTime')">
                        <el-date-picker
                            v-model="queryForm.enrolDate"
                            value-format="timestamp"
                            type="month"
                            style="width: 100%"
                            :placeholder="$t('common.text.all')"
                        ></el-date-picker>
                    </el-form-item>
                </el-col>
                <el-col :span="8">
                    <el-form-item :label="$t('label.currentLeaveSchool')">
                        <el-select
                            v-model="queryForm.leaveSchool"
                            style="width: 100%;"
                            clearable
                            :placeholder="$t('common.text.all')"
                        >
                            <el-option
                                v-for="item in options.leaveSchool"
                                :key="item.value"
                                :label="item.label"
                                :value="item.value"
                            />
                        </el-select>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row :gutter="24">
                <el-col :span="8">
                    <el-form-item :label="$t('stuRegister.registType')">
                        <el-select
                            v-model="queryForm.registType"
                            style="width: 100%;"
                            clearable
                            :placeholder="$t('common.text.all')"
                        >
                            <el-option
                                v-for="item in options.registType"
                                :key="item.value"
                                :label="item.label"
                                :value="item.value"
                            />
                        </el-select>
                    </el-form-item>
                </el-col>
                <el-col :span="8">
                    <el-form-item :label="$t('stuRegister.unregistReason')">
                        <el-select
                            v-model="queryForm.registReason"
                            style="width: 100%;"
                            clearable
                            :placeholder="$t('common.text.all')"
                        >
                            <el-option
                                v-for="item in options.registReason"
                                :key="item.value"
                                :label="item.label"
                                :value="item.value"
                            />
                        </el-select>
                    </el-form-item>
                </el-col>
                <el-col :span="8">
                    <el-form-item :label="$t('stuRegister.paymentStatus')">
                        <el-select
                            v-model="queryForm.paymentStatus"
                            style="width: 100%;"
                            clearable
                            :placeholder="$t('common.text.all')"
                        >
                            <el-option
                                v-for="item in options.paymentStatus"
                                :key="item.value"
                                :label="item.label"
                                :value="item.value"
                            />
                        </el-select>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row :gutter="24">
                <el-col :span="8">
                    <el-form-item :label="$t('label.enrolSeason')">
                        <el-select
                            v-model="queryForm.enrolSeason"
                            style="width: 100%;"
                            :placeholder="$t('common.text.all')"
                        >
                            <el-option
                                v-for="item in options.enrolSeason"
                                :key="item.value"
                                :label="item.label"
                                :value="item.value"
                            />
                        </el-select>
                    </el-form-item>
                </el-col>
            </el-row>
        </condition-card>
        <!--注册时间说明-->
        <el-card shadow="never" class="desc" v-if="bks||yjs||bs||jwy">
            <div class="title">{{$t('stuRegister.explain')}}</div>
            <el-row class="date-explain">
                <el-col :span="6" v-if="bks">
                    <div class="date-type">本科生：</div>
                    <div class="date-list">
                        <div v-for="(t,index_) in bks" :key="'bks'+index_">{{t}}</div>
                    </div>
                </el-col>
                <el-col :span="6" v-if="yjs">
                    <div class="date-type">硕士：</div>
                    <div class="date-list">
                        <div v-for="(t,index_) in yjs" :key="'yjs'+index_">{{t}}</div>
                    </div>
                </el-col>
                <el-col :span="6" v-if="bs">
                    <div class="date-type">博士：</div>
                    <div class="date-list">
                        <div v-for="(t,index_) in bs" :key="'bs'+index_">{{t}}</div>
                    </div>
                </el-col>
                <el-col :span="6" v-if="jwy">
                    <div class="date-type">教务员：</div>
                    <div class="date-list">
                        <div v-for="(t,index_) in jwy" :key="'jwy'+index_">{{t}}</div>
                    </div>
                </el-col>
            </el-row>
        </el-card>
        <el-card shadow="never">
            <div class="edu-page-title">{{$t('stuRegister.registManageList')}}</div>
            <el-row style="margin-bottom:16px">
                <el-col :span="4">
                    <el-input
                        v-model="queryForm.keyWord"
                        :placeholder="$t('score.failScoreManage.pleaseInt')"
                        @keyup.enter.native="onSubmit"
                        style="width:200px"
                    >
                        <i
                            class="el-icon-search"
                            slot="suffix"
                            style="margin-top:10px;cursor:pointer"
                            @click="onSubmit"
                        ></i>
                    </el-input>
                </el-col>
                <el-col :span="20">
                    <div class="float-right">
                        <el-button
                            v-if="visible.newRegister"
                            @click="registerNew"
                        >{{$t('stuRegister.newStuRegister')}}</el-button>
                        <el-button 
                        v-if="visible.manualUpdate"
                        @click="manualUpdate"
                        >手工更新</el-button>
                        <el-button
                            v-if="visible.specialRegister"
                            @click="registerSpecial"
                        >{{$t('stuRegister.specialRegister')}}</el-button>
                        <el-button
                            v-if="visible.batchRegister"
                            @click="register"
                        >{{$t('stuRegister.regist')}}</el-button>
                        <el-button
                            v-if="visible.registerReason"
                            @click="unregisteredReason"
                        >{{$t('stuRegister.unregistReason')}}</el-button>
                        <el-button
                            v-if="visible.batchUnregister"
                            @click="deregister"
                        >{{$t('stuRegister.deregister')}}</el-button>

                        <el-dropdown
                            @command="exportStudents"
                            v-if="visible.exportStudents||visible.exportDBF"
                        >
                            <el-button type="primary">
                                {{$t("message.export")}}
                                <i
                                    class="el-icon-arrow-down el-icon--right"
                                ></i>
                            </el-button>
                            <el-dropdown-menu slot="dropdown">
                                <el-dropdown-item
                                    command="exportRegistList"
                                    v-if="visible.exportStudents"
                                >导出注册情况列表</el-dropdown-item>
                                <el-dropdown-item command="exportDBf" v-if="visible.exportDBF && projectId == 2">导出学信网</el-dropdown-item>
                                <el-dropdown-item command="exportRegsitDBf" v-if="projectId == 1">导出学籍注册DBF</el-dropdown-item>
                                <el-dropdown-item command="exportYearDBf" v-if="projectId == 1">导出学年注册DBF</el-dropdown-item>
                                <el-dropdown-item command="1" v-if="projectId == 1">导出贫困地区专项生标注DBF</el-dropdown-item>
                                <el-dropdown-item command="0" v-if="projectId == 1">导出预科生资格核对DBF</el-dropdown-item>
                                <el-dropdown-item command="true" v-if="projectId == 1">导出保留入学资格DBF</el-dropdown-item>
                                <el-dropdown-item command="false" v-if="projectId == 1">导出放弃入学资格DBF</el-dropdown-item>
                            </el-dropdown-menu>
                        </el-dropdown>
                    </div>
                </el-col>
            </el-row>
            <edu-table
                :data="students"
                size="mini"
                style="width:100%"
                :order="false"
                @page-change="handleCurrentChange"
                :total="queryForm.total_"
                :pageSize="queryForm.pageSize_"
                :current-page="queryForm.pageNum_"
                @selection-change="selectionChange"
                :selectFixed="true"
                :page-sizes="[10, 20, 50, 100, 500, 1000]"
            >
              <!-- 本科生列表 -->
              <template v-if="isUndergraduate()">
                <el-table-column :label="$t('label.stuCode')" fixed show-overflow-tooltip>
                    <template slot-scope="scope">{{ scope.row.studentId }}</template>
                </el-table-column>
                <el-table-column :label="$t('label.stuName')" fixed show-overflow-tooltip>
                    <template slot-scope="scope">{{ scope.row.name }}</template>
                </el-table-column>
                <el-table-column :label="$t('label.college')" width="140" show-overflow-tooltip fixed>
                    <template slot-scope="scope">{{ scope.row.facultyI18n }}</template>
                </el-table-column>
                <el-table-column :label="$t('label.major')" width="140" show-overflow-tooltip fixed>
                    <template slot-scope="scope">{{ scope.row.professionI18n }}</template>
                </el-table-column>
                <el-table-column :label="$t('tutorAuth.currentGrade')" show-overflow-tooltip>
                    <template slot-scope="scope">{{ scope.row.currentGrade }}</template>
                </el-table-column>
                <el-table-column :label="$t('label.trainingLevel')" show-overflow-tooltip>
                    <template slot-scope="scope">{{ scope.row.trainingLevelI18n }}</template>
                </el-table-column>
                <el-table-column
                  :label="$t('label.trainingCategory')"
                  width="100"
                  prop="trainingCategoryI18n"
                ></el-table-column>
                <el-table-column :label="$t('label.enrolSeason')" show-overflow-tooltip>
                    <template slot-scope="scope">{{ scope.row.enrolSeasonI18n }}</template>
                </el-table-column>
                <el-table-column :label="$t('dic.degreeType')" width="100" show-overflow-tooltip>
                    <template slot-scope="scope">{{ scope.row.degreeTypeI18n }}</template>
                </el-table-column>
                <el-table-column
                  :label="$t('label.formLearning')"
                  width="100"
                  show-overflow-tooltip
                >
                    <template slot-scope="scope">{{ scope.row.formLearningI18n }}</template>
                </el-table-column>
                <el-table-column label="当前在校状态" width="140" show-overflow-tooltip>
                    <template slot-scope="scope">{{ scope.row.leaveSchoolI18n }}</template>
                </el-table-column>
                <el-table-column label="是否国际学生" width="120" show-overflow-tooltip>
                    <template slot-scope="scope">{{ scope.row.isOverseasI18n }}</template>
                </el-table-column>
                <el-table-column
                  :label="$t('label.schoolTerm')"
                  show-overflow-tooltip
                  width="170"
                >
                    <template slot-scope="scope">{{ scope.row.calendarName }}</template>
                </el-table-column>
                <el-table-column
                  :label="$t('stuRegister.registDate')"
                  width="100"
                  show-overflow-tooltip
                >
                    <template slot-scope="scope">{{ getFormateDate(scope.row.registTime) }}</template>
                </el-table-column>
                <el-table-column
                  :label="$t('stuRegister.operator')"
                  width="120"
                  show-overflow-tooltip
                >
                    <template slot-scope="scope">
                        <span v-if="scope.row.operator == null"></span>
                        <span
                          v-if="scope.row.operator != null"
                        >{{ scope.row.operator + '(' + scope.row.operatorName + ')' }}</span>
                    </template>
                </el-table-column>
                <el-table-column :label="$t('message.remark')" width="100">
                    <template slot-scope="scope">
                        <el-popover
                          placement="top"
                          v-if="scope.row.specialReason||scope.row.registReasonI18n"
                          width="250"
                          trigger="hover"
                        >
                            <div>
                                <div
                                  v-if="scope.row.specialReason"
                                >特殊注册原因：{{scope.row.specialReason}}</div>
                                <div v-else>未注册原因：{{scope.row.registReasonI18n}}</div>
                            </div>
                            <div style="cursor:pointer" slot="reference">
                                <div
                                  v-if="scope.row.specialReason"
                                >{{scope.row.specialReason.substr(0,5)}}...</div>
                                <div v-else>{{scope.row.registReasonI18n.substr(0,5)}}...</div>
                            </div>
                        </el-popover>
                    </template>
                </el-table-column>
                <el-table-column :label="$t('stuRegister.registStatus')" show-overflow-tooltip fixed="right">
                    <template slot-scope="scope">{{ scope.row.registStatusI18n }}</template>
                </el-table-column>
                <el-table-column label="报到状态" show-overflow-tooltip fixed="right">
                    <template slot-scope="scope">{{ scope.row.reportStatus == 0?'未报到' : '已报到' }}</template>
                </el-table-column>
                <el-table-column :label="$t('stuRegister.registType')" show-overflow-tooltip fixed="right">
                    <template slot-scope="scope">{{ scope.row.registTypeI18n }}</template>
                </el-table-column>
                <el-table-column :label="$t('stuRegister.paymentStatus')" show-overflow-tooltip fixed="right">
                    <template slot-scope="scope">
                        <el-tag
                          :type="scope.row.paymentStatus!='0'?'info':null"
                        >{{getPaymentStatusText(scope.row.paymentStatus)}}</el-tag>
                    </template>
                </el-table-column>
                <el-table-column :label="$t('label.operation')" fixed="right" width="60">
                    <template slot-scope="scope">
                        <el-button
                          v-if="visible.unregister&&scope.row.registStatus==1"
                          type="text"
                          @click="deregisterSingle(scope)"
                        >{{$t('stuRegister.deregister')}}</el-button>
                    </template>
                </el-table-column>
              </template>
              <!-- 研究生列表 -->
              <template v-if="isGraduateStudent()">
                <el-table-column label="学号" prop="studentId" fixed show-overflow-tooltip width="100"/>
                <el-table-column label="姓名" prop="name" fixed show-overflow-tooltip width="100"/>
                <el-table-column label="培养层次" prop="trainingLevelI18n" fixed show-overflow-tooltip width="80"/>
                <el-table-column label="导师" prop="teacherCodeAndName" fixed show-overflow-tooltip width="120"/>

                <el-table-column label="年级" prop="currentGrade" show-overflow-tooltip width="80"/>
                <el-table-column label="学院" prop="facultyI18n" show-overflow-tooltip width="140" v-if="isShowFaculty()"/>
                <el-table-column label="专业" prop="professionI18n" show-overflow-tooltip width="120"/>
                <el-table-column label="培养类别" prop="trainingCategoryI18n" show-overflow-tooltip width="100"/>
                <el-table-column label="学习形式" prop="formLearningI18n" show-overflow-tooltip width="120"/>
                <el-table-column label="当前在校状态" prop="leaveSchoolI18n" show-overflow-tooltip width="120"/>
                <el-table-column label="是否国际学生" prop="isOverseasI18n" show-overflow-tooltip width="120"/>
                <el-table-column label="学年学期" prop="calendarName" show-overflow-tooltip width="140"/>
                <el-table-column label="注册时间" show-overflow-tooltip width="120">
                  <template slot-scope="scope">{{ getFormateDate(scope.row.registTime) }}</template>
                </el-table-column>
                <el-table-column label="操作人" show-overflow-tooltip width="120">
                  <template slot-scope="scope">
                        <span v-if="scope.row.operator == null"></span>
                        <span
                          v-if="scope.row.operator != null"
                        >{{ scope.row.operator + '(' + scope.row.operatorName + ')' }}</span>
                    </template>
                </el-table-column>
                <el-table-column label="备注" prop="studentId" show-overflow-tooltip width="120">
                   <template slot-scope="scope">
                        <el-popover
                          placement="top"
                          v-if="scope.row.specialReason||scope.row.registReasonI18n"
                          width="250"
                          trigger="hover"
                        >
                            <div>
                                <div
                                  v-if="scope.row.specialReason"
                                >特殊注册原因：{{scope.row.specialReason}}</div>
                                <div v-else>未注册原因：{{scope.row.registReasonI18n}}</div>
                            </div>
                            <div style="cursor:pointer" slot="reference">
                                <div
                                  v-if="scope.row.specialReason"
                                >{{scope.row.specialReason.substr(0,5)}}...</div>
                                <div v-else>{{scope.row.registReasonI18n.substr(0,5)}}...</div>
                            </div>
                        </el-popover>
                    </template>
                </el-table-column>

                <el-table-column label="是否欠费" prop="studentId" fixed="right" show-overflow-tooltip width="80">
                  <template slot-scope="scope">
                        <el-tag
                          :type="scope.row.paymentStatus!='0'?'info':null"
                        >{{getPaymentStatusText(scope.row.paymentStatus)}}</el-tag>
                    </template>
                </el-table-column>
                <el-table-column label="注册状态" prop="registStatusI18n" fixed="right" show-overflow-tooltip width="80"/>
                <el-table-column label="注册类型" prop="registTypeI18n" fixed="right" show-overflow-tooltip width="80"/>
                <el-table-column :label="$t('label.operation')" fixed="right" width="60">
                    <template slot-scope="scope">
                        <el-button
                          v-if="visible.unregister&&scope.row.registStatus==1"
                          type="text"
                          @click="deregisterSingle(scope)"
                        >{{$t('stuRegister.deregister')}}</el-button>
                    </template>
                </el-table-column>
              </template>
            </edu-table>
        </el-card>
        <edu-dialog
            ref="specialDialog"
            :title="$t('stuRegister.specialRegister')"
            @close="closeSpecialStudent"
            @confirm="saveSpecialStudent"
            size="small"
        >
            <el-form
                label-suffix="："
                label-position="right"
                label-width="120px"
                ref="specialForm"
                :model="specialForm"
                :rules="specialRules"
            >
                <el-row>
                    <el-col :span="21">
                        <el-form-item :label="$t('label.schoolTerm')" prop="calendarId">
                            <CalendarSelect
                                v-model="specialForm.calendarId"
                                @change="handleCalendarChange"
                            ></CalendarSelect>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="21">
                        <el-form-item :label="$t('label.stuCode')" prop="studentId">
                            <el-input v-model="specialForm.studentId" @blur="handleCheckStudentId"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="21">
                        <el-form-item :label="$t('label.stuName')">
                            <el-input v-model="specialForm.name" disabled placeholder="由学号带出"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="21">
                        <el-form-item :label="$t('label.grade')">
                            <el-input v-model="specialForm.grade" disabled placeholder="由学号带出"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="21">
                        <el-form-item :label="$t('label.college')">
                            <el-input v-model="specialForm.college" disabled placeholder="由学号带出"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="21">
                        <el-form-item :label="$t('label.major')">
                            <el-input v-model="specialForm.major" disabled placeholder="由学号带出"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="21">
                        <el-form-item
                            :label="$t('stuRegister.specialRegisterReason')"
                            prop="reason"
                        >
                            <el-input
                                type="textarea"
                                rows="3"
                                maxlength="255"
                                v-model="specialForm.reason"
                                :placeholder="$t('stuRegister.maxLength')"
                            ></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
            </el-form>
        </edu-dialog>
        <edu-dialog
            ref="newStudentDialog"
            :title="$t('stuRegister.newStuRegister')"
            @close="closeNewStudentCallBack"
            width="420px"
        >
            <div slot="buttons">
                <el-button @click="closeNewStudDialog">{{$t('message.return')}}</el-button>
                <el-button @click="saveNewStudent" type="primary">注册</el-button>
            </div>
            <el-form
                label-suffix="："
                label-position="right"
                label-width="120px"
                ref="newStudentForm"
                :model="newStudentForm"
                :rules="newStudentRules"
            >
                <el-row :gutter="24">
                    <el-col :span="24">
                        <el-form-item :label="$t('label.schoolTerm')" prop="calendarId">
                            <CalendarSelect v-model="newStudentForm.calendarId"></CalendarSelect>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row :gutter="24">
                    <el-col :span="24">
                        <el-form-item :label="$t('label.trainingLevel')" prop="trainingLevelList">
                            <el-select
                                v-model="newStudentForm.trainingLevelList"
                                multiple
                                collapse-tags
                                style="width: 100%;"
                                clearable
                                :placeholder="$t('common.text.all')"
                            >
                                <el-option
                                    v-for="item in options.trainingLevel"
                                    :key="item.value"
                                    :label="item.label"
                                    :value="item.value"
                                />
                            </el-select>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row :gutter="24">
                    <el-col :span="24">
                        <el-form-item :label="$t('label.trainingCategory')" prop="trainingCategory">
                            <el-select
                                v-model="newStudentForm.trainingCategory"
                                style="width: 100%;"
                                clearable
                                :placeholder="$t('common.text.all')"
                            >
                                <el-option
                                    v-for="item in options.trainingCategory"
                                    :key="item.value"
                                    :label="item.label"
                                    :value="item.value"
                                />
                            </el-select>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row :gutter="24">
                    <el-col :span="24">
                        <el-form-item :label="$t('label.formLearning')" prop="formLearning">
                            <el-select
                                v-model="newStudentForm.formLearning"
                                style="width: 100%;"
                                clearable
                                :placeholder="$t('common.text.all')"
                            >
                                <el-option
                                    v-for="item in options.formLearning"
                                    :key="item.value"
                                    :label="item.label"
                                    :value="item.value"
                                />
                            </el-select>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row :gutter="24">
                    <el-col :span="24">
                        <el-form-item :label="$t('label.isOverseas')" prop="isOverseas">
                            <el-select
                                v-model="newStudentForm.isOverseas"
                                style="width: 100%;"
                                clearable
                                :placeholder="$t('common.text.all')"
                            >
                                <el-option
                                    v-for="item in options.isOverseas"
                                    :key="item.value"
                                    :label="item.label"
                                    :value="item.value"
                                />
                            </el-select>
                        </el-form-item>
                    </el-col>
                </el-row>
            </el-form>
        </edu-dialog>
        <edu-dialog
            ref="unregisterDialog"
            :title="$t('stuRegister.unregistReason')"
            @close="closeUnregisterStudent"
            @confirm="saveUnregisterStudent"
            size="small"
        >
            <el-form
                label-suffix=":"
                label-position="left"
                label-width="100px"
                ref="unregisterStudentForm"
                :model="unregisterStudentForm"
                :rules="unregisterStudentRules"
            >
                <el-row>
                    <el-col :span="20">
                        <el-form-item
                            :label="$t('stuRegister.unregistReason')"
                            prop="unregisteredReason"
                        >
                            <el-select
                                v-model="unregisterStudentForm.unregisteredReason"
                                style="width: 100%;"
                            >
                                <el-option
                                    v-for="item in options.registReason"
                                    :key="item.value"
                                    :label="item.label"
                                    :value="item.value"
                                />
                            </el-select>
                        </el-form-item>
                    </el-col>
                </el-row>
            </el-form>
        </edu-dialog>
    </div>
</template>
<script>
import { queryDic } from "common/src/api/dictionary";
import {
    registManageList,
    exportRegistList,
    exportStuRegisteredDbf,
    exportStuRegisteredYearDbf,
    exportMatAndPovertyDbf,
    exportAdmissionDbf,
    registPrompt,
    exportStatusDbf,
    deregistration,
    newStuRegist,
    specialRegist,
    addUnregisteredReason,
    registered,
    specialRegistStudent,
    newStuRegistered
} from "common/src/api/studentRegister";
import UTILS from "common/src/utils/utils";
import moment from "moment";
import mixin from 'common/src/mixins/index';
export default {
    name: "RegisterRoleManage",
    mixins: [mixin],
    data() {
        return {
            queryForm: {
                calendarId: null,
                registStatus: null,
                currentGrade: null,
                facultyList: [],
                professionList: [],
                trainingLevelList: [],
                trainingCategory: null,
                degreeType: null,
                formLearning: null,
                isOverseas: null,
                leaveSchool: null,
                enrolDate: null,
                registType: null,
                registReason: null,
                keyWord: null,
                pageSize_: 20,
                pageNum_: 1,
                total_: 0,
                paymentStatus: null,
                enrolSeason: null
            },
            specialForm: {
                calendarId: null,
                studentId: null,
                name: null,
                grade: null,
                college: null,
                major: null,
                reason: null,
                isCorrect: false,
                id: null
            },
            newStudentForm: {
                calendarId: null,
                trainingLevelList: [],
                trainingCategory: null,
                isOverseas: null,
                formLearning: null
            },
            unregisterStudentForm: {
                unregisteredReason: ""
            },
            specialRules: {
                calendarId: [
                    {
                        required: true,
                        message: "请输入学期",
                        trigger: "blur"
                    }
                ],
                studentId: [
                    {
                        required: true,
                        message: "请输入学号",
                        trigger: "blur"
                    }
                ],
                reason: [
                    {
                        required: true,
                        message: this.$t(
                            "stuRegister.inputSpecialRegisterReason"
                        ),
                        trigger: "blur"
                    }
                ]
            },
            newStudentRules: {
                trainingLevelList: [
                    {
                        required: true,
                        message: "请选择培养层次",
                        trigger: "blur"
                    }
                ],
                trainingCategory: [
                    {
                        required: false,
                        message: "请选择培养类别",
                        trigger: "blur"
                    }
                ],
                isOverseas: [
                    {
                        required: true,
                        message: "请选择是否国际学生",
                        trigger: "blur"
                    }
                ],
                formLearning: [
                    {
                        required: false,
                        message: "请选择学习形式",
                        trigger: "blur"
                    }
                ],
                calendarId: [
                    {
                        required: true,
                        message: "请选择学年学期",
                        trigger: "blur"
                    }
                ]
            },
            unregisterStudentRules: {
                unregisteredReason: [
                    {
                        required: true,
                        message: this.$t("stuRegister.selectUnRegisterReason"),
                        trigger: "blur"
                    }
                ]
            },
            options: {
                college: [],
                major: [],
                formLearning: [],
                trainingLevel: [],
                trainingCategory: [],
                registStatus: [],
                isOverseas: [],
                degreeType: [],
                leaveSchool: [],
                registType: [],
                registReason: [],
                enrolSeason: [],
                paymentStatus: [
                    { value: 1, label: "是" },
                    { value: 0, label: "否" },
                ]
            },
            students: [],
            projectId: null, // 1 本科生  2 研究生  4在职
            currentCalendarId: null,
            selectedStudents: [],
            bks: null,
            yjs: null,
            bs: null,
            jwy: null,
            visible: {
                read: false,
                exportStudents: false,
                exportDBF: false,
                unregister: false,
                batchRegister: false,
                batchUnregister: false,
                specialRegister: false,
                newRegister: false,
                registerReason: false,
                manualUpdate:false
            },
            currentDptId: null,
            showRegistTime: false,
            timeId: null,
            currentUser: {},
            auths:[]
        };
    },
    created() {
        this.projectId = this.global.projectId
        let session = localStorage.getItem("sessiondata");
        session = JSON.parse(session);
        let user = session.mockUser || session.user;
        this.currentUser = user;
        this.currentDptId = user.currentManageDptId;
        if (user.uid == "admin1") {
            this.visible.read = true;
            this.visible.exportStudents = true;
            this.visible.exportDBF = true;
            this.showRegistTime = true;
            // return;
        }
        // 1.管理员 2.教务员 3.导师 4.老师 5.留办老师 6.学生
        if (user.innerRoles.includes("1")) {
            this.visible.read = true;
            this.visible.exportStudents = true;
            this.visible.exportDBF = true;
            this.visible.unregister = true;
            this.visible.batchUnregister = true;
            this.visible.specialRegister = true;
            this.visible.newRegister = true;
            this.visible.registerReason = true;
            this.showRegistTime = true;
        }
        if (user.innerRoles.includes("2")) {
            this.visible.read = true;
            this.visible.unregister = true;
            this.visible.batchRegister = true;
            this.visible.batchUnregister = true;
            this.visible.registerReason = true;
            this.visible.exportStudents = true;
            this.visible.specialRegister = true;
            this.showRegistTime = true;
        }
        if (user.innerRoles.includes("6")) {
            this.visible.read = true;
            this.visible.exportStudents = true;
            this.showRegistTime = true;
        }
        this.auths = session.auths;
        this.auths.forEach(item => {
            if(item.authCode === 'Register_New_Student'){
                this.visible.newRegister = true
            }
            if(item.authCode === 'Register_Special'){
                this.visible.specialRegister = true
            }
            if(item.authCode === 'RegisterManage_Register'){
                this.visible.batchRegister = true
            }
            if(item.authCode === 'RegisterManage_Unregister'){
                this.visible.registerReason = true
            }
            if(item.authCode === 'RegisterManage_Deregister'){
                this.visible.batchUnregister = true
            }
            if(item.authCode === 'RegisterManage_Update'){
                this.visible.manualUpdate = true
            }
        })        
    },
    mounted() {
        this.init();
    },
    methods: {
        // 判断是否为本科生
        isUndergraduate () {
          return this.currentUser.currentManageDptId && this.currentUser.currentManageDptId.toString() === '1';
        },
        // 判断是否为研究生
        isGraduateStudent () {
          const currentManageDptId = this.currentUser.currentManageDptId && this.currentUser.currentManageDptId.toString();
          // return currentManageDptId === '2' || currentManageDptId === '4';
          return currentManageDptId !== '1';
        },
        // 是否显示学院
        isShowFaculty() {
          const innerRoles = this.currentUser.innerRoles || [];
          return innerRoles.includes('1');
        },
        init() {
            let _this = this
            let data = {
                lang: this.$store.getters.language || "cn",
                type: "allChild",
                keys: [
                    "X_PYCC",
                    "X_PYLB",
                    "X_YX",
                    "X_XWLX",
                    "X_XXXS",
                    "isAborad",
                    "K_ZXZT",
                    "K_WZCYY",
                    "K_ZCZT",
                    "K_ZCFS",
                    "X_RXJJ"
                ]
            };
            queryDic(data).then(res => {
                if (res.code == 200) {
                    UTILS.fillSelect(
                        {
                            college: "X_YX",
                            trainingLevel: "X_PYCC",
                            formLearning: "X_XXXS",
                            trainingCategory: "X_PYLB",
                            isOverseas: "isAborad",
                            degreeType: "X_XWLX",
                            leaveSchool: "K_ZXZT",
                            registStatus: "K_ZCZT",
                            registType: "K_ZCFS",
                            registReason: "K_WZCYY",
                            enrolSeason: "X_RXJJ"
                        },
                        res.data,
                        this.options
                    );
                    if(res.data && res.data.K_ZXZT) {
                        _this.options.leaveSchool = []
                        for(let key in res.data.K_ZXZT) {
                            if(key != 3 && key != 4) {
                                _this.options.leaveSchool.push( {
                                    label: res.data.K_ZXZT[key],
                                    value: key
                                })
                            }
                        }
                    }
                }
            });
        },
        reset() {
            this.queryForm.calendarId = this.currentCalendarId;
            this.queryForm.registStatus = null;
            this.queryForm.currentGrade = null;
            this.queryForm.facultyList = [];
            this.queryForm.professionList = [];
            this.queryForm.trainingLevelList = [];
            this.queryForm.trainingCategory = null;
            this.queryForm.degreeType = null;
            this.queryForm.formLearning = null;
            this.queryForm.isOverseas = null;
            this.queryForm.leaveSchool = null;
            this.queryForm.enrolDate = null;
            this.queryForm.registType = null;
            this.queryForm.registReason = null;
            this.queryForm.keyWord = null;
            this.queryForm.enrolSeason = null;
            this.options.major = [];
            this.queryForm.paymentStatus = null;
            this.onSubmit();
        },
        onSubmit() {
            registManageList(this.queryForm).then(res => {
                if (res.code == 200) {
                    this.students = res.data.list;
                    this.queryForm.total_ = res.data.total_;
                }
            });
        },
        manualUpdate() {
            let params = _.cloneDeep(this.queryForm);
            params.updateDateFlag = 1;
            registManageList(params).then(res => {
                if (res.code == 200) {
                    this.$message({
                        type: "success",
                        message: this.$t("course.operateSuccess")
                    });
                    this.students = res.data.list;
                    this.queryForm.total_ = res.data.total_;
                }
            });
        },
        changeFaculty() {
            this.options.major = [];
            this.queryForm.professionList = [];
            const data = {
                lang: this.$store.getters.language || "cn",
                type: "allChild",
                keys: ["G_ZY"],
                filter: {
                    prefix: this.queryForm.facultyList,
                    specilaCode: "XY2ZY",
                    facultys: this.queryForm.facultyList,
                    grade: this.queryForm.currentGrade,
                    degreeType: this.queryForm.degreeType
                        ? [this.queryForm.degreeType]
                        : []
                }
            };
            queryDic(data).then(res => {
                if (res.code === 200)
                    UTILS.fillSelect({ major: "G_ZY" }, res.data, this.options);
            });
        },
        handleCurrentChange(val) {
            this.queryForm.pageSize_ = val.pageSize;
            this.queryForm.pageNum_ = val.pageNum;
            this.onSubmit();
        },
        //新生注册
        registerNew() {
            this.$refs.newStudentDialog.open();
            this.newStudentForm.calendarId = this.currentCalendarId;
        },
        //特殊注册
        registerSpecial() {
            this.$refs.specialDialog.open();
            this.$refs.specialForm.clearValidate();
        },
        //注册
        register() {
            if (this.selectedStudents.length == 0) {
                this.$message({
                    type: "info",
                    message: this.$t("stuRegister.noSelectedStu")
                });
                return;
            }
            if (this.selectedStudents.some(s => s.registStatus == 1)) {
                this.$message({
                    type: "info",
                    message: "选中学生必须都是未注册状态"
                });
                return;
            }
            registered(this.selectedStudents.map(s => s.id)).then(res => {
                if (res.code == 200) {
                    this.showRegistResult(res);
                    this.onSubmit();
                }
            });
        },
        //未注册原因
        unregisteredReason() {
            if (this.selectedStudents.length == 0) {
                this.$message({
                    type: "info",
                    message: this.$t("stuRegister.noSelectedStu")
                });
                return;
            }
            if (this.selectedStudents.some(s => s.registStatus == 1)) {
                this.$message({
                    type: "info",
                    message: "选中学生必须都是未注册状态"
                });
                return;
            }
            this.$refs.unregisterDialog.open();
        },
        //撤销
        deregister() {
            if (this.selectedStudents.length == 0) {
                this.$message({
                    type: "info",
                    message: this.$t("stuRegister.noSelectedStu")
                });
                return;
            }
            if (this.selectedStudents.some(s => s.registStatus != 1)) {
                this.$message({
                    type: "info",
                    message: "选中学生有未注册状态，无法执行撤销操作"
                });
                return;
            }
            deregistration(this.selectedStudents.map(s => s.id).join(",")).then(
                res => {
                    if (res.code == 200) {
                        this.$message({
                            type: "success",
                            message: this.$t("stuRegister.cancelSuccess")
                        });
                        this.onSubmit();
                    }
                }
            );
        },
        exportStudents(command) {
            let parm = {
                    calendarId: this.queryForm.calendarId,
                    facultyStr: this.queryForm.facultyList?this.queryForm.facultyList.join(','):'',
                    professionStr: this.queryForm.professionList?this.queryForm.professionList.join(','):'',
                    trainingLevelStr: this.queryForm.trainingLevelList?this.queryForm.trainingLevelList.join(','):'',
                    trainingCategory: this.queryForm.trainingCategory,
                    degreeType: this.queryForm.degreeType,
                    formLearning: this.queryForm.formLearning,
                    isOverseas: this.queryForm.isOverseas,
                    enrolDate: this.queryForm.enrolDate,
                    enrolSeason: this.queryForm.enrolSeason,
                    leaveSchool: this.queryForm.leaveSchool,
                    registeredType: this.queryForm.registType,
                    registeredReason: this.queryForm.registReason,
                    isArrears: this.queryForm.paymentStatus,
                    idsStr: this.selectedStudents.map(s => s.id)?this.selectedStudents.map(s => s.id).join(','):'',
                    keyWord: this.queryForm.keyWord,
                    currentGrade: this.queryForm.currentGrade,
                    registeredStatus: this.queryForm.registStatus,
                    exportType: null,
                    keep: null
                }
                if(!parm.idsStr) {
                    parm.idsStr = ''
                }
            if (command == "exportRegistList") {
                window.open(exportRegistList(this.queryForm));
            } else if(command == 'exportRegsitDBf') {
                // exportStatusDbf(parm).then(res=> {
                //     if(res.code === 200) {
                //         if(res.data) {
                //             window.open('/api/studentservice/stuRegister/exportDbf?path=' + res.data);
                //         } else {
                //             this.$message.error("无数据")
                //         }
                //     }
                // })
                window.open(exportStatusDbf(parm));

            } else if(command == 'exportYearDBf') {
                window.open(exportStuRegisteredYearDbf(parm));
            }else if(command == '0') {
                parm.exportType = '0'
                window.open(exportMatAndPovertyDbf(parm));
            }else if(command == '1') {
                parm.exportType = '1'
                window.open(exportMatAndPovertyDbf(parm));
            } else if(command == 'true') {
                parm.keep = true
                window.open(exportAdmissionDbf(parm));
            }else if(command == 'false') {
                parm.keep = false
                window.open(exportAdmissionDbf(parm));
            }
            else {
                window.open(exportStuRegisteredDbf(this.queryForm));
            }
        },
        done() {
            this.currentCalendarId = this.queryForm.calendarId;
            if (this.showRegistTime) {
                this.loadRegisterTime(this.currentCalendarId);
            }
            this.onSubmit();
        },
        loadRegisterTime(calendarId) {
            this.bks = null;
            this.yjs = null;
            this.bs = null;
            this.jwy = null;
            if (calendarId == null) return;
            registPrompt(calendarId).then(res => {
                if (res.code == 200 && res.data) {
                    let fn = list => {
                        return list.map(t =>
                            t.endTime
                                ? this.getFormateDate(t.startTime) +
                                  "~" +
                                  this.getFormateDate(t.endTime)
                                : this.getFormateDate(t.startTime) + "~"
                        );
                    };

                    if (res.data.bks) {
                        this.bks = fn(res.data.bks);
                    }
                    if (res.data.yjs) {
                        this.yjs = fn(res.data.yjs);
                    }
                    if (res.data.bs) {
                        this.bs = fn(res.data.bs);
                    }
                    if (res.data.jwy) {
                        this.jwy = fn(res.data.jwy);
                    }
                }
            });
        },
        selectionChange(val) {
            this.selectedStudents = val;
        },
        //关闭特殊学生对话框
        closeSpecialStudent() {
            if (this.timeId) {
                clearTimeout(this.timeId);
                this.timeId = null;
            }
            //this.specialForm.calendarId = null;
            this.specialForm.studentId = null;
            this.specialForm.reason = null;
            this.resetSpecialForm();
            this.$refs.specialDialog.close();
        },
        resetSpecialForm() {
            this.specialForm.isCorrect = false;
            this.specialForm.name = null;
            this.specialForm.grade = null;
            this.specialForm.college = null;
            this.specialForm.major = null;
            this.specialForm.id = null;
        },
        //保存特殊学生
        saveSpecialStudent() {
            let fn = () => {
                if (!this.specialForm.isCorrect) {
                    this.$message({
                        type: "warning",
                        message: "输入学生不符合特殊注册要求!"
                    });
                    return;
                }
                this.$refs.specialForm.validate(valid => {
                    if (valid) {
                        //缴费状态查询与特殊学生注册接口相同，type=0为注册，type=1为缴费状态查询
                        let query = {
                            ids: [this.specialForm.id],
                            specialReason: encodeURI(this.specialForm.reason),
                            type: 1
                        };
                        specialRegist(query).then(res => {
                            if (res.code == 200) {
                                //若缴费直接提交;若未缴费，弹出提示框
                                if (res.data == null) {
                                    this.submitSpecialRegist();
                                } else {
                                    let message = null;
                                    if (typeof res.data === "string") {
                                        message = res.data;
                                    } else if (typeof res.data === "object") {
                                        for (let key in res.data) {
                                            message = key;
                                        }
                                    }
                                    if (res.msg === "0") {
                                        this.$eduAlert(message);
                                    } else {
                                        this.$eduConfirm(
                                            message,
                                            this.$t("message.prompt"),
                                            {   
                                                showConfirmButton:false,
                                                showCancelButton:false,
                                                confirmButtonText: this.$t(
                                                    "message.yes"
                                                ),
                                                cancelButtonText: this.$t(
                                                    "message.no"
                                                )
                                            }
                                        ).then(() => {
                                            // this.submitSpecialRegist();
                                        });
                                    }
                                }
                            }
                        });
                    } else {
                        return false;
                    }
                });
            };
            if (this.timeId) {
                clearTimeout(this.timeId);
                this.timeId = null;
                this.resetSpecialForm();
                specialRegistStudent(
                    this.specialForm.studentId,
                    this.specialForm.calendarId
                ).then(res => {
                    if (res.code == 200) {
                        this.specialForm.id = res.data.id;
                        this.specialForm.isCorrect = true;
                        this.specialForm.name = res.data.name;
                        this.specialForm.grade = res.data.currentGrade;
                        this.specialForm.college = res.data.faculty;
                        this.specialForm.major = res.data.profession;
                        fn();
                    }
                });
            } else {
                fn();
            }
        },
        submitSpecialRegist() {
            let query = {
                ids: [this.specialForm.id],
                specialReason: encodeURI(this.specialForm.reason),
                type: 0
            };
            specialRegist(query).then(res => {
                if (res.code == 200) {
                    this.$message({
                        type: "success",
                        message: "注册成功!"
                    });
                    this.$refs.specialDialog.close();
                    this.onSubmit();
                }
            });
        },
        closeNewStudDialog() {
            this.$refs.newStudentDialog.close();
        },
        //关闭新生注册回调
        closeNewStudentCallBack() {
            this.$refs.newStudentForm.clearValidate();
            this.newStudentForm.isOverseas = null;
            this.newStudentForm.trainingCategory = null;
            this.newStudentForm.formLearning = null;
            this.newStudentForm.trainingLevelList = [];
        },
        //保存新生注册
        saveNewStudent() {
            this.$refs.newStudentForm.validate(valid => {
                if (valid) {
                    newStuRegistered(this.newStudentForm).then(res => {
                        if (res.code == 200) {
                            this.$message({
                                type: "success",
                                message: "注册成功!"
                            });
                            this.$refs.newStudentDialog.close();
                            this.onSubmit();
                        }
                    });
                }
            });
        },
        closeUnregisterStudent() {
            this.$refs.unregisterStudentForm.clearValidate();
            this.$refs.unregisterDialog.close();
            this.unregisterStudentForm.unregisteredReason = null;
        },
        saveUnregisterStudent() {
            this.$refs.unregisterStudentForm.validate(valid => {
                if (valid) {
                    let ids = this.selectedStudents.map(s => s.id).join(","),
                        unregisteredReason = this.unregisterStudentForm
                            .unregisteredReason;
                    addUnregisteredReason(ids, unregisteredReason).then(res => {
                        if (res.code == 200) {
                            this.$message({
                                type: "success",
                                message: this.$t("message.saveSuccess")
                            });
                            this.$refs.unregisterDialog.close();
                            this.onSubmit();
                        }
                    });
                } else {
                    return false;
                }
            });
        },
        deregisterSingle(scope) {
            deregistration(scope.row.id).then(res => {
                if (res.code == 200) {
                    this.$message({
                        type: "success",
                        message: this.$t("stuRegister.cancelSuccess")
                    });
                    this.onSubmit();
                }
            });
        },
        getFormateDate(val) {
            return val ? moment(val).format("YYYY-MM-DD") : null;
        },
        calendarChange(val) {
            if (this.showRegistTime) {
                this.loadRegisterTime(val);
            }
        },
        //显示注册结果
        showRegistResult(res) {
            if (res.data) {
                let msg = "";
                for (const key in res.data) {
                    msg += "<div style='margin:5px 0'>" + key + "</div>";
                }
                this.$message({
                    showClose: true,
                    duration: 0,
                    dangerouslyUseHTMLString: true,
                    type: "error",
                    message: msg
                });
            } else {
                this.$message({
                    type: "success",
                    message: "报到成功!"
                });
            }
        },
        handleCheckStudentId() {
            if (
                this.specialForm.studentId != null &&
                this.specialForm.studentId != ""
            ) {
                this.resetSpecialForm();
                this.timeId = setTimeout(() => {
                    specialRegistStudent(
                        this.specialForm.studentId,
                        this.specialForm.calendarId
                    ).then(res => {
                        if (res.code == 200) {
                            this.specialForm.id = res.data.id;
                            this.specialForm.isCorrect = true;
                            this.specialForm.name = res.data.name;
                            this.specialForm.grade = res.data.currentGrade;
                            this.specialForm.college = res.data.faculty;
                            this.specialForm.major = res.data.profession;
                        }
                    });
                    this.timeId = null;
                }, 300);
            }
        },
        handleCalendarChange() {
            if (this.specialForm.studentId) {
                this.handleCheckStudentId();
            }
        },
        getPaymentStatusText(val) {
            let p = this.options.paymentStatus.find(p => p.value == val);
            return p.value == 1 ? '是' : '否';
        }
    }
};
</script>
<style lang="scss" scoped>
.desc {
    background-color: rgba(255, 0, 0, 0.1);
    .title {
        color: red;
        margin-bottom: 10px;
    }
    p {
        display: inline-block;
        font:last-child {
            margin-right: 15px;
        }
    }
}
.date-explain {
    .date-type {
        float: left;
        width: 25%;
    }
    .date-list {
        float: left;
        width: 75%;
        & div + div {
            margin-top: 5px;
        }
    }
}
</style>
